home *** CD-ROM | disk | FTP | other *** search
/ SGI Varsity Update 1998 August / SGI Varsity Update 1998 August.iso / dist / dist6.5 / il_dev.idb / usr / include / il / ilCropImg.h.z / ilCropImg.h
C/C++ Source or Header  |  1998-07-29  |  3KB  |  99 lines

  1. #if 0 
  2.  
  3.     Copyright (c) 1991 SGI   All Rights Reserved
  4.     THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SGI
  5.     The copyright notice above does not evidence any
  6.     actual or intended publication of such source code,
  7.     and is an unpublished work by Silicon Graphics, Inc.
  8.     This material contains CONFIDENTIAL INFORMATION that
  9.     is the property of Silicon Graphics, Inc. Any use,
  10.     duplication or disclosure not specifically authorized
  11.     by Silicon Graphics is strictly prohibited.
  12.     
  13.     RESTRICTED RIGHTS LEGEND:
  14.     
  15.     Use, duplication or disclosure by the Government is
  16.     subject to restrictions as set forth in subdivision
  17.     (c)(1)(ii) of the Rights in Technical Data and Computer
  18.     Software clause at DFARS 52.227-7013, and/or in similar
  19.     or successor clauses in the FAR, DOD or NASA FAR
  20.     Supplement.  Unpublished- rights reserved under the
  21.     Copyright Laws of the United States.  Contractor is
  22.     SILICON GRAPHICS, INC., 2011 N. Shoreline Blvd.,
  23.     Mountain View, CA 94039-7311
  24.  
  25. #endif
  26.  
  27. /*
  28.     Defines a rectangular subregion and/or channel subset of a parent image.
  29. */
  30.  
  31. #ifndef _ilCropImg_h_
  32. #define _ilCropImg_h_
  33.  
  34. #include <il/ilImage.h>
  35.  
  36. class ilCropImg : public ilImage {
  37. public:
  38.     iflClassListDeclare
  39.     ~ilCropImg();
  40.  
  41.     // external api: begin
  42.     ilCropImg(ilImage* src=NULL, int xs=0, int ys=0, int nx=0, int ny=0)
  43.         { init(src, xs, ys, 0, 0, nx, ny); }
  44.  
  45.     // external api: name=ilCropImgList
  46.     ilCropImg(ilImage* src, int nc, int* clist) 
  47.         { init(src, 0, 0, 0, 0, 0, 0, 0, nc, clist); }
  48.  
  49.     void getOrigin(int& xs, int& ys, int& zs)
  50.     { xs = origin.x; ys = origin.y; zs = origin.z; }
  51.     // external api: name=getOrigin4D
  52.     void getOrigin(int& xs, int& ys, int& zs, int& cs)
  53.     { xs = origin.x; ys = origin.y; zs = origin.z; cs = origin.c; }
  54.     
  55.     void setOrigin(const int xs, const int ys, const int zs=0);
  56.  
  57.     // external api: name=setOrigin4D
  58.     void setOrigin(const int xs, const int ys, const int zs, const int cs);
  59.     
  60.     void setChannelList(int nc, int *clist);
  61.     void clearChannelList();
  62.  
  63.     void setClip(int x, int y, int nx, int ny);
  64.     // external api: name=setClip3D
  65.     void setClip(int x, int y, int z, int nx, int ny, int nz);
  66.  
  67.     void clearClip();
  68.     void getClip(int& x, int& y, int& z, int& nx, int& ny, int& nz)
  69.     { 
  70.     x = clip.x; y = clip.y; z = clip.z; 
  71.     nx = clip.nx; ny = clip.ny; nz = clip.nz; 
  72.     }
  73.  
  74.     // external api: end
  75.  
  76.     virtual ilStatus qGetSubTile3D(ilMpNode* parent, int x, int y, int z, 
  77.                    int nx, int ny, int nz, void*& data, int dx, 
  78.                    int dy, int dz, int dnx, int dny, int dnz,
  79.                    const ilConfig* config=NULL, 
  80.                    ilMpManager** pMgr=NULL);
  81.  
  82. protected:
  83.     virtual void reset();
  84.     virtual ilHwOp* hwDefine();
  85.  
  86. private:
  87.     iflXYZCint origin;            // origin of subimage
  88.     iflTile clip;            // clip area of subimage
  89.     int* channelList;            // spec for permuting channels
  90.  
  91.     void init(ilImage* src, int xs=0, int ys=0, int zs=0, int cs=0, 
  92.           int nx=0, int ny=0, int nz=0, int nc=0, int *clist=NULL);
  93.     int makeConfig(ilConfig& config, const ilConfig* cfg);
  94.     ilImageTile* getInputTileRequirement(const iflTile3Dint& tile, int c,int nc,
  95.                                          int* chans, int& inputTileCount);
  96. };
  97.  
  98. #endif
  99.